// @ts-ignore
/* eslint-disable */
import { request } from '@umijs/max';
const apiPrefix = '/web';

/** 编辑字典项 PUT /sys/dict/item */
export async function sysDictItemControllerEdit(
  body: API.SysDictItem,
  options?: { [key: string]: any },
) {
  return request<API.ApiResultString>(`${apiPrefix}/sys/dict/item`, {
    method: 'PUT',
    headers: {
      'Content-Type': 'application/json',
    },
    data: body,
    ...(options || {}),
  });
}

/** 新增字典项 POST /sys/dict/item */
export async function sysDictItemControllerSave(
  body: API.SysDictItem,
  options?: { [key: string]: any },
) {
  return request<API.ApiResultString>(`${apiPrefix}/sys/dict/item`, {
    method: 'POST',
    headers: {
      'Content-Type': 'application/json',
    },
    data: body,
    ...(options || {}),
  });
}

/** 批量删除字典项 DELETE /sys/dict/item */
export async function sysDictItemControllerDeleteBatch(
  body: number[],
  options?: { [key: string]: any },
) {
  return request<API.ApiResultString>(`${apiPrefix}/sys/dict/item`, {
    method: 'DELETE',
    headers: {
      'Content-Type': 'application/json',
    },
    data: body,
    ...(options || {}),
  });
}

/** 删除字典项 DELETE /sys/dict/item/${param0} */
export async function sysDictItemControllerDelete(
  // 叠加生成的Param类型 (非body参数swagger默认没有生成对象)
  params: API.sysDictItemControllerDeleteParams,
  options?: { [key: string]: any },
) {
  const { itemId: param0, ...queryParams } = params;
  return request<API.ApiResultString>(`${apiPrefix}/sys/dict/item/${param0}`, {
    method: 'DELETE',
    params: { ...queryParams },
    ...(options || {}),
  });
}

/** 导入字典项 POST /sys/dict/item/batch */
export async function sysDictItemControllerSaveBatch(body: {}, options?: { [key: string]: any }) {
  return request<API.ApiResultString>(`${apiPrefix}/sys/dict/item/batch`, {
    method: 'POST',
    headers: {
      'Content-Type': 'application/json',
    },
    data: body,
    ...(options || {}),
  });
}

/** 导出字典项 GET /sys/dict/item/export */
export async function sysDictItemControllerExport(
  // 叠加生成的Param类型 (非body参数swagger默认没有生成对象)
  params: API.sysDictItemControllerExportParams,
  options?: { [key: string]: any },
) {
  return request<any>(`${apiPrefix}/sys/dict/item/export`, {
    method: 'GET',
    params: {
      ...params,
    },
    ...(options || {}),
  });
}
